﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Agro.Library;
using SN.Core;
using Agro.Models;
using Ninject;
using Agro.Services;
using SN.Data;
using System.Data;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Agro.Web.Areas.SystemManage.Controllers
{
    public class BbztController : BaseController
    {
        //
        // GET: /SystemManage/Bbzt/

        [Inject]
        public IBbztService BbztService { get; set; }

        public ActionResult BbztList()
        {
            return View();
        }

        public ActionResult GetBbztList(QueryBase query,string ReportID)
        {
            WhereClip where = WhereClip.All;
            var list = BbztService.GetEntityList<T_Report>(where, query);
            return JqGrid(list, query);
        }

        [HttpPost]
        public ActionResult Save()
        {
            string Msg = string.Empty;
            string ReportID = Convert.ToString(Request["Report_ID"]);
            string sValue = Convert.ToString(Request["Report_Sfky"]);

            Msg = BbztService.Save(ReportID, sValue);
            return Json(Msg);
        }

    }
}
